package com.leeoohoo.common;


public class UserHolder {


    private static final ThreadLocal<UserContext> myUserDetailsThreadLocal = new ThreadLocal<>();

    public static ThreadLocal<UserContext> getCurrent() {
        return myUserDetailsThreadLocal;
    }

    public static UserContext getMyUser() {
        return myUserDetailsThreadLocal.get();
    }

    public static void setMyUser(UserContext myUserDetails) {
        myUserDetailsThreadLocal.set(myUserDetails);
    }

    public static void clean() {
        myUserDetailsThreadLocal.remove();
    }
}
